//
//  CDMNetTool.h
//  TodatPlay
//
//  Created by dllo on 16/8/31.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void(^successBlock)(id result);
typedef void(^failureBlock)(NSError *error);

typedef NS_ENUM(NSUInteger, CDMResponseStyle) {
    CDMJSON,
    CDMDATA,
    CDMXML,
};

typedef NS_ENUM(NSUInteger, CDMRequestStyle) {
    CDMBodyString,
    CDMBodyJSON,
};

@interface CDMNetTool : NSObject

+(void)GET:(NSString *)url
   andBody:(id)body
 andHeader:(NSDictionary *)headers
andResponse:(CDMResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;

+(void)POST:(NSString *)url
    andBody:(id)body
andBodyStyle:(CDMRequestStyle)bodyStyle
  andHeader:(NSDictionary *)headers
andResponse:(CDMResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;
@end
